﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Gozib.Web.Models
{
    public class CollectionManager
    {
        public static List<SelectListItem> AgeList()
        {
            List<SelectListItem> items = new List<SelectListItem>();
            items.Add(new SelectListItem { Selected = true, Text = "Age", Value = "0" });
            foreach (var item in Enumerable.Range(1, 100))
            {
                items.Add(new SelectListItem { Text = item.ToString(), Value = item.ToString() });
            }

            return items;
        }

        public static List<SelectListItem> ExpiryMonths()
        {
            List<SelectListItem> items = new List<SelectListItem>
            {
                new SelectListItem{Text="Jan", Value="01"}, new SelectListItem{Text="Feb", Value="02"},
                new SelectListItem{Text="Mar", Value="03"}, new SelectListItem{Text="Apr", Value="04"},
                new SelectListItem{Text="May", Value="05"}, new SelectListItem{Text="Jun", Value="06"},
                new SelectListItem{Text="Jul", Value="07"}, new SelectListItem{Text="Aug", Value="08"},
                new SelectListItem{Text="Sep", Value="09"}, new SelectListItem{Text="Oct", Value="10"},
                new SelectListItem{Text="Nov", Value="11"}, new SelectListItem{Text="Dec", Value="12"},
            };

            return items;
        }

        public static List<SelectListItem> ExpiryYears()
        {
            List<SelectListItem> items = new List<SelectListItem>();
            foreach (var item in Enumerable.Range(DateTime.Now.Year, 15))
            {
                items.Add(new SelectListItem { Text = item.ToString(), Value = item.ToString() });
            }

            return items;
        }
    }
}